import axios from './config'

//定义请求接口

//注册
export const registerApi = (user_name: string, password: string) =>
  axios.post('/users/register', {
    user_name,
    password,
  })

//登入

export const loginApi = (user_name: string, password: string) =>
  axios.post('/users/login', {
    user_name,
    password,
  })

//获取验证码

export const getCaptchaApi = () => axios.get('/users/getCaptcha')

//校验验证码

export const verifyCaptchaApi = (captcha: string) =>
  axios.get('/users/verifyCaptcha', {
    params: {
      captcha,
    },
  })
